import { defineStore } from 'pinia';

export const useManageStore = defineStore('manage', {
  state: () => ({
    name:'',
    dealer:'',
    logo:'',
    auth:'',
    userId:'',
    account:'',
  }),
  actions: {
    setManageInfo(name,dealer,logo,auth,userId,account){
      this.name = name;
      this.dealer = dealer;
      this.logo = logo;
      this.auth = auth;
      this.userId = userId;
      this.account = account;
    },
  },
  persist: {
    key: 'custom_key',      // 默认是 store id (manage)
    storage: sessionStorage, 
    paths: ['name', 'dealer','logo','auth','userId','account'], // 只持久化部分字段
  },
})